package com.ssm.annotation;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service("service")
public class UserServiceimpl implements UseService {

    @Resource(name = "userDao") //保证我们不是空的
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
//我们想调用UserDao中的方法

    @Override
    public void save() {
        //调用userDao中的方法
        this.userDao.save();
        System.out.println("userservice..save..");
    }
}
